import {
  createRouter,
  // createWebHashHistory, //哈希模式
  createWebHistory //history模式
} from 'vue-router'
import { setupPermission } from '@/permission'
import routes from './routes'

export const router = createRouter({
  history: createWebHistory(VITE_APP_BASE_URL),
  routes,
  scrollBehavior: () => {
    // 内容区滚动条刷新
    const contentScrollEle = document.querySelector('.content .scroll-wrap')
    if (contentScrollEle) {
      contentScrollEle.scrollTop = 0
    }
  }
})
setupPermission(router)
